package com.aspose.cells.a.d;

import com.aspose.cells.ImageFormat;
import com.aspose.cells.ImageOrPrintOptions;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.io.IOException;
import javax.imageio.ImageIO;

public class zbn {
   public static float a = 96.0F;
   private static final com.aspose.cells.b.c.a.za c = new com.aspose.cells.b.c.a.za(new String[]{"bmp", "emf", "jpg", "jpeg", "png", "wmf", "pict", "gif", "tif", "tiff", "IHDR", "pHYs", "IEND"});

   public static int a(com.aspose.cells.b.a.d.zm var0) throws Exception {
      var0.b(0L);
      byte[] var1 = new byte[64];
      var0.a(var1, 0, var1.length);
      var0.b(0L);
      return a(var1);
   }

   public static int a(byte[] var0) throws Exception {
      if (j(var0)) {
         return 2;
      } else if (k(var0)) {
         return 2;
      } else if (m(var0)) {
         return 1;
      } else if (d(var0)) {
         return 4;
      } else if (e(var0)) {
         return 5;
      } else if (f(var0)) {
         return 6;
      } else if (h(var0)) {
         return 3;
      } else if (g(var0)) {
         return 7;
      } else {
         return c(var0) ? 8 : 0;
      }
   }

   public static String a(int var0) {
      switch(var0) {
      case 1:
         return "emf";
      case 2:
         return "wmf";
      case 3:
         return "pict";
      case 4:
         return "jpeg";
      case 5:
         return "png";
      case 6:
         return "bmp";
      case 7:
         return "gif";
      case 8:
         return "tif";
      default:
         throw new IllegalStateException("Cannot convert image type to string.");
      }
   }

   public static int a(ImageFormat var0) {
      if (var0.equals(ImageFormat.getJpeg())) {
         return 4;
      } else if (var0.equals(ImageFormat.getPng())) {
         return 5;
      } else if (var0.equals(ImageFormat.getEmf())) {
         return 1;
      } else if (var0.equals(ImageFormat.getWmf())) {
         return 2;
      } else if (var0.equals(ImageFormat.getBmp())) {
         return 6;
      } else if (var0.equals(ImageFormat.getGif())) {
         return 7;
      } else {
         return var0.equals(ImageFormat.getTiff()) ? 8 : 0;
      }
   }

   public static zbm b(byte[] var0) throws Exception {
      return a(var0, a(var0));
   }

   public static zbm a(byte[] var0, int var1) throws Exception {
      switch(var1) {
      case 1:
         return u(var0);
      case 2:
         return t(var0);
      case 3:
         return v(var0);
      case 4:
         return s(var0);
      case 5:
         return r(var0);
      case 6:
         return p(var0);
      case 7:
         return q(var0);
      default:
         return zbm.a(100, 100, (double)a, (double)a);
      }
   }

   public static boolean c(byte[] var0) throws Exception {
      assert var0 != null;

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      boolean var4;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         short var3 = var2.n();
         var4 = var3 == 18761 || var3 == 19789;
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var4;
   }

   public static boolean d(byte[] var0) throws Exception {
      assert var0 != null;

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      boolean var5;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         long var3 = (long)(var2.p() & '\uffff');
         if ((var3 & 4294967295L) != 55551L) {
            var5 = false;
            return var5;
         }

         var5 = true;
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var5;
   }

   public static boolean e(byte[] var0) throws Exception {
      assert var0 != null;

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      boolean var5;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         long var3 = var2.r();
         if ((var3 & 4294967295L) == 1196314761L) {
            long var11 = var2.r();
            boolean var7;
            if ((var11 & 4294967295L) != 169478669L) {
               var7 = false;
               return var7;
            }

            var7 = true;
            return var7;
         }

         var5 = false;
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var5;
   }

   public static boolean f(byte[] var0) throws Exception {
      assert var0 != null;

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      boolean var5;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         long var3 = (long)(var2.p() & '\uffff');
         if ((var3 & 4294967295L) == 19778L) {
            long var24 = var2.r();
            var2.r();
            long var7 = var2.r();
            if ((var24 & 4294967295L) != 0L && (var7 & 4294967295L) > (var24 & 4294967295L)) {
               boolean var25 = false;
               return var25;
            }

            long var9 = 12L;
            long var11 = 16L;
            long var13 = var2.r();
            boolean var15 = var13 == var9;
            if (!var15 && (var13 & 4294967295L) < (var11 & 4294967295L)) {
               boolean var26 = false;
               return var26;
            }

            if (var15) {
               var2.r();
            } else {
               var2.q();
               var2.q();
            }

            long var16 = (long)(var2.p() & '\uffff');
            if ((var16 & 4294967295L) != 1L) {
               boolean var27 = false;
               return var27;
            }

            long var18 = (long)(var2.p() & '\uffff');
            boolean var20;
            if ((var18 & 4294967295L) != 1L && (var18 & 4294967295L) != 4L && (var18 & 4294967295L) != 8L && (var18 & 4294967295L) != 16L && (var18 & 4294967295L) != 24L && (var18 & 4294967295L) != 32L) {
               var20 = false;
               return var20;
            }

            var20 = true;
            return var20;
         }

         var5 = false;
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var5;
   }

   public static boolean g(byte[] var0) throws Exception {
      assert var0 != null;

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      boolean var4;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         int var3 = var2.q() & 16777215;
         var4 = var3 == 4606279;
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var4;
   }

   public static boolean h(byte[] var0) throws Exception {
      assert var0 != null;

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      boolean var4;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         var2.p();
         var2.p();
         var2.p();
         var2.p();
         var2.p();
         int var3 = zcq.b(var2.p()) & '\uffff';
         if (var3 != 273) {
            if (var3 == 17) {
               int var9 = zcq.b(var2.p()) & '\uffff';
               if (var9 == 767) {
                  boolean var5 = true;
                  return var5;
               }
            }

            var4 = false;
            return var4;
         }

         var4 = true;
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var4;
   }

   public static boolean i(byte[] var0) throws Exception {
      assert var0 != null;

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      boolean var5;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         long var3 = (long)(var2.p() & '\uffff');
         if ((var3 & 4294967295L) == 40L) {
            var5 = true;
            return var5;
         }

         var5 = false;
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var5;
   }

   public static boolean j(byte[] var0) throws Exception {
      assert var0 != null;

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      boolean var6;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         short var3 = var2.n();
         if (var3 != 0 && var3 != 1) {
            boolean var10 = false;
            return var10;
         }

         short var4 = var2.n();
         if (var4 != 9) {
            boolean var11 = false;
            return var11;
         }

         var2.n();
         var2.q();
         var2.n();
         var2.q();
         short var5 = var2.n();
         if (var5 == 0) {
            var6 = true;
            return var6;
         }

         var6 = false;
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var6;
   }

   public static boolean k(byte[] var0) throws Exception {
      assert var0 != null;

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      boolean var6;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         long var3 = var2.r();
         if ((var3 & 4294967295L) != 2596720087L) {
            boolean var10 = false;
            return var10;
         }

         short var5 = var2.n();
         if (var5 == 0) {
            var6 = true;
            return var6;
         }

         var6 = false;
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var6;
   }

   public static boolean l(byte[] var0) throws Exception {
      return j(var0) || k(var0);
   }

   public static boolean m(byte[] var0) throws Exception {
      assert var0 != null;

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      boolean var7;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         long var3 = var2.r();
         if ((var3 & 4294967295L) != 1L) {
            boolean var11 = false;
            return var11;
         }

         var2.k().b(40L);
         long var5 = var2.r();
         if ((var5 & 4294967295L) != 1179469088L) {
            var7 = false;
            return var7;
         }

         var7 = true;
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var7;
   }

   public static int n(byte[] var0) throws Exception {
      if (m(var0)) {
         com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

         byte var8;
         try {
            com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
            var2.r();
            long var3 = var2.r();
            var2.k().b(var3);
            long var5 = var2.r();
            if ((var5 & 4294967295L) != 70L) {
               byte var14 = 3;
               return var14;
            }

            var2.q();
            var2.q();
            int var7 = var2.q();
            if (var7 == 726027589) {
               int var15 = var2.p() & '\uffff';
               if (var15 != 16385) {
                  byte var16 = 3;
                  return var16;
               }

               int var9 = var2.p() & '\uffff';
               byte var10;
               if ((var9 & 1) == 1) {
                  var10 = 5;
                  return var10;
               }

               var10 = 4;
               return var10;
            }

            var8 = 3;
         } finally {
            if (var1 != null) {
               var1.a();
            }

         }

         return var8;
      } else {
         return 0;
      }
   }

   public static byte[] o(byte[] var0) throws Exception {
      assert var0 != null;

      assert i(var0) : "Expected a DIB here.";

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      byte[] var3;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         var3 = b(var2, var0.length);
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var3;
   }

   private static byte[] b(com.aspose.cells.b.a.d.za var0, int var1) throws Exception {
      int var2 = (int)var0.k().i();
      zz var3 = new zz();
      var3.a(var0);
      var0.k().b((long)var2);
      byte[] var4 = new byte[14 + var1];
      com.aspose.cells.b.a.d.zh var5 = new com.aspose.cells.b.a.d.zh(var4);

      byte[] var8;
      try {
         com.aspose.cells.b.a.d.zb var6 = new com.aspose.cells.b.a.d.zb(var5);
         zy var7 = new zy();
         var7.b = (long)(14 + var1);
         var7.e = (long)(54 + var3.a());
         var7.a(var6);
         var6.b();
         var0.a(var4, 14, var1);
         var8 = var4;
      } finally {
         if (var5 != null) {
            var5.a();
         }

      }

      return var8;
   }

   public static byte[] a(com.aspose.cells.b.a.d.za var0, int var1, int var2) throws Exception {
      int var3 = (int)var0.k().i();
      zz var4 = new zz();
      var4.a(var0);
      int var5 = 40 + var4.a();
      byte[] var6 = var0.g(var4.a());
      var0.k().b((long)(var3 + var1));
      byte[] var7 = new byte[14 + var5 + var2];
      com.aspose.cells.b.a.d.zh var8 = new com.aspose.cells.b.a.d.zh(var7);

      byte[] var11;
      try {
         com.aspose.cells.b.a.d.zb var9 = new com.aspose.cells.b.a.d.zb(var8);
         zy var10 = new zy();
         var10.b = (long)(14 + var5 + var2);
         var10.e = (long)(14 + var5);
         var10.a(var9);
         var4.a(var9);
         var9.a(var6);
         var9.b();
         var0.a(var7, 14 + var5, var2);
         var11 = var7;
      } finally {
         if (var8 != null) {
            var8.a();
         }

      }

      return var11;
   }

   public static com.aspose.cells.b.a.b.za a(com.aspose.cells.b.a.d.za var0, int var1) throws Exception {
      com.aspose.cells.b.a.d.zh var2 = new com.aspose.cells.b.a.d.zh(b(var0, var1));
      return (com.aspose.cells.b.a.b.za)com.aspose.cells.b.a.b.zj.a((com.aspose.cells.b.a.d.zm)var2);
   }

   public static com.aspose.cells.b.a.b.za b(com.aspose.cells.b.a.d.za var0, int var1, int var2) throws Exception {
      com.aspose.cells.b.a.d.zh var3 = new com.aspose.cells.b.a.d.zh(a(var0, var1, var2));
      com.aspose.cells.b.a.b.za var4 = null;

      try {
         var4 = (com.aspose.cells.b.a.b.za)com.aspose.cells.b.a.b.zj.a((com.aspose.cells.b.a.d.zm)var3);
      } catch (Exception var6) {
         ;
      }

      return var4;
   }

   public static zbm p(byte[] var0) throws Exception {
      assert f(var0);

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      zbm var5;
      try {
         var1.b(14L);
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         zz var3 = new zz();
         var3.a(var2);
         zbm var4 = zbm.a(var3.b, var3.c, (double)var3.h / 39.37007874015748D, (double)var3.i / 39.37007874015748D);
         if (var4.d() == 0.0D) {
            var4.a((double)a);
         }

         if (var4.e() == 0.0D) {
            var4.b((double)a);
         }

         var5 = var4;
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var5;
   }

   public static zbm q(byte[] var0) throws Exception {
      assert g(var0);

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      zbm var5;
      try {
         var1.b(6L);
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         int var3 = var2.p();
         int var4 = var2.p();
         var5 = zbm.a(var3 & '\uffff', var4 & '\uffff', (double)a, (double)a);
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var5;
   }

   public static zbm r(byte[] var0) throws Exception {
      assert e(var0);

      zbm var1 = zbm.a();
      com.aspose.cells.b.a.d.zh var2 = new com.aspose.cells.b.a.d.zh(var0);

      try {
         zu var3 = new zu(var2);
         byte var4 = 8;
         var2.b((long)var4);

         long var6;
         for(boolean var5 = false; !var5 && var2.i() < var2.h(); var2.a((var6 & 4294967295L) + 4L, 1)) {
            var6 = var3.c();
            String var8 = new String(var3.b(4));
            switch(c.a(var8)) {
            case 10:
               var1.a(var3.b());
               var1.b(var3.b());
               var2.a(-8L, 1);
               break;
            case 11:
               long var9 = var3.c();
               long var11 = var3.c();
               byte var13 = var3.f();
               if (var13 == 1) {
                  var1.a((double)(var9 & 4294967295L) / 39.37007874015748D);
                  var1.b((double)(var11 & 4294967295L) / 39.37007874015748D);
               }

               var5 = true;
               break;
            case 12:
               var5 = true;
            }
         }

         zbm var17 = var1;
         return var17;
      } finally {
         if (var2 != null) {
            var2.a();
         }

      }
   }

   public static zbm s(byte[] var0) throws Exception {
      assert d(var0);

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      zbm var7;
      try {
         zbm var2 = zbm.a();
         zu var3 = new zu(var1);
         var3.e();

         for(int var4 = var3.e(); (var4 & '\uffff' & '\ufff0') != 65472 || (var4 & '\uffff') == 65476 || (var4 & '\uffff') == 65484; var4 = var3.e()) {
            if (!a(var4, var3, var2)) {
               int var5 = var3.e();
               var1.a((long)((var5 & '\uffff') - 2), 1);
            }
         }

         if (var2.d() == 0.0D) {
            var2.a(96.0D);
         }

         if (var2.e() == 0.0D) {
            var2.b(96.0D);
         }

         byte var11 = 2;
         byte var6 = 1;
         var1.a((long)(var11 + var6), 1);
         var2.b(var3.e());
         var2.a(var3.e());
         var7 = var2;
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var7;
   }

   private static boolean a(int var0, zu var1, zbm var2) throws Exception {
      if ((var0 & '\uffff') == 65504) {
         a(var1, var2);
         return true;
      } else if ((var0 & '\uffff') == 65505) {
         b(var1, var2);
         return true;
      } else {
         return false;
      }
   }

   private static void a(zu var0, zbm var1) throws Exception {
      int var2 = var0.e();
      byte var3 = 5;
      byte var4 = 2;
      var0.a().a((long)(var3 + var4), 1);
      byte var5 = var0.f();
      int var6 = var0.e();
      int var7 = var0.e();
      switch(var5) {
      case 0:
      default:
         break;
      case 1:
         var1.a((double)var6);
         var1.b((double)var7);
         break;
      case 2:
         double var8 = 2.54D;
         var1.a((double)(var6 & '\uffff') * var8);
         var1.b((double)(var7 & '\uffff') * var8);
      }

      var0.a().a((long)((var2 & '\uffff') - (2 + var3 + var4 + 1 + 2 + 2)), 1);
   }

   private static void b(zu var0, zbm var1) throws Exception {
      long var2 = var0.a().i();
      int var4 = var0.e();
      String var5 = new String(var0.b(6));
      if (var5.startsWith("Exif")) {
         long var6 = var0.a().i();
         short var8 = var0.d();
         boolean var9 = var8 == 19789;
         a(var0, var9);
         long var11 = b(var0, var9);
         var0.a().a((var11 & 4294967295L) - 8L, 1);
         int var13 = a(var0, var9);

         for(int var14 = 0; var14 < (var13 & '\uffff'); ++var14) {
            int var15 = a(var0, var9);
            a(var0, var9);
            b(var0, var9);
            long var19 = b(var0, var9);
            if ((var15 & '\uffff') == 282) {
               var1.a(a(var0, var6 + (var19 & 4294967295L), var9));
            }

            if ((var15 & '\uffff') == 283) {
               var1.b(a(var0, var6 + (var19 & 4294967295L), var9));
            }
         }
      }

      var0.a().b(var2 + (long)(var4 & '\uffff'));
   }

   private static double a(zu var0, long var1, boolean var3) throws Exception {
      long var4 = var0.a().i();
      var0.a().b(var1);
      long var6 = b(var0, var3);
      long var8 = b(var0, var3);
      var0.a().b(var4);
      return (double)((var6 & 4294967295L) / (var8 & 4294967295L));
   }

   private static int a(zu var0, boolean var1) throws Exception {
      int var2 = var0.e();
      if (!var1) {
         var2 = zcq.b(var2);
      }

      return var2;
   }

   private static long b(zu var0, boolean var1) throws Exception {
      long var2 = var0.c();
      if (!var1) {
         var2 = zcq.a(var2);
      }

      return var2;
   }

   public static zbm t(byte[] var0) throws Exception {
      assert l(var0);

      if (j(var0)) {
         return w(var0);
      } else if (k(var0)) {
         com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

         zbm var5;
         try {
            com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
            zci var3 = new zci();
            var3.a(var2);
            zbm var4 = zbm.a(var3.b().g(), var3.b().h(), var3.b().i(), var3.b().j(), (double)var3.c(), (double)var3.c());
            if (var4.b() > 0 || var4.c() > 0) {
               var5 = var4;
               return var5;
            }

            var5 = w(var0);
         } finally {
            if (var1 != null) {
               var1.a();
            }

         }

         return var5;
      } else {
         throw new IllegalStateException("Unexpected image type.");
      }
   }

   private static zbm w(byte[] var0) throws Exception {
      zbz var1 = new zbz(var0);
      return zbm.a((int)var1.i().b(), (int)var1.i().c(), (double)var1.g(), (double)var1.h());
   }

   public static zbm u(byte[] var0) throws Exception {
      assert m(var0);

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      zbm var4;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         zcc var3 = new zcc();
         var3.a(var2);
         var4 = zbm.a(var3.a().g(), var3.a().h(), var3.a().i(), var3.a().j(), (double)var3.c(), (double)var3.d());
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var4;
   }

   public static zbm v(byte[] var0) throws Exception {
      assert h(var0);

      com.aspose.cells.b.a.d.zh var1 = new com.aspose.cells.b.a.d.zh(var0);

      zbm var9;
      try {
         com.aspose.cells.b.a.d.za var2 = new com.aspose.cells.b.a.d.za(var1);
         var2.p();
         int var3 = zcq.b(var2.p()) & '\uffff';
         int var4 = zcq.b(var2.p()) & '\uffff';
         int var5 = zcq.b(var2.p()) & '\uffff';
         int var6 = zcq.b(var2.p()) & '\uffff';
         int var7 = zaj.f((double)(var6 - var4));
         int var8 = zaj.f((double)(var5 - var3));
         var9 = zbm.a(var4, var3, var6, var5, var7, var8);
      } finally {
         if (var1 != null) {
            var1.a();
         }

      }

      return var9;
   }

   public static com.aspose.cells.b.a.b.za a(int var0, int var1) {
      com.aspose.cells.b.a.b.za var2 = new com.aspose.cells.b.a.b.za(var0, var1, 2498570);
      var2.a(a, a);
      return var2;
   }

   static com.aspose.cells.b.a.b.za a(com.aspose.cells.b.a.b.za var0) {
      com.aspose.cells.b.a.b.za var1 = a(var0.i(), var0.h());
      var1.a(var0.j(), var0.k());
      BufferedImage var2 = var1.f();
      Graphics2D var3 = var2.createGraphics();
      var3.drawImage(var0.f(), 0, 0, Color.white, (ImageObserver)null);
      var3.dispose();
      return var1;
   }

   public static void a(com.aspose.cells.b.a.b.zj var0, com.aspose.cells.b.a.d.zm var1) throws Exception {
      com.aspose.cells.b.a.b.za var2 = new com.aspose.cells.b.a.b.za(var0.i(), var0.h(), 139273);
      var2.a(var0.j(), var0.k());
      Graphics2D var3 = var2.f().createGraphics();
      var3.drawImage(var0.f(), 0, 0, (ImageObserver)null);
      var3.setColor(Color.white);
      var3.clearRect(0, 0, var0.i(), var0.h());
      ImageIO.write(var2.f(), "BMP", var1.j());
   }

   public static void b(com.aspose.cells.b.a.b.zj var0, com.aspose.cells.b.a.d.zm var1) throws IOException, Exception {
      com.aspose.cells.b.a.b.za var2 = new com.aspose.cells.b.a.b.za(var0.i(), var0.h(), 2498570);
      var2.a(var0.j(), var0.k());
      Graphics2D var3 = var2.f().createGraphics();
      var3.drawImage(var0.f(), 0, 0, (ImageObserver)null);
      ImageIO.write(var2.f(), "PNG", var1.j());
   }

   public static void a(com.aspose.cells.b.a.b.zj var0, com.aspose.cells.b.a.d.zm var1, long var2) throws Exception {
      com.aspose.cells.b.a.b.za var4 = new com.aspose.cells.b.a.b.za(var0.i(), var0.h(), 139273);
      Graphics2D var5 = var4.f().createGraphics();
      var5.drawImage(var0.f(), 0, 0, (ImageObserver)null);
      var5.dispose();
      ImageOrPrintOptions var6 = new ImageOrPrintOptions();
      var6.setHorizontalResolution((int)var0.j());
      var6.setVerticalResolution((int)var0.k());
      var6.setQuality((int)var2);
      zbo.a(var4.f(), var6, var1.j());
      var4.d();
      var4 = null;
   }

   public static com.aspose.cells.b.a.b.za a(com.aspose.cells.b.a.b.za var0, int var1) {
      return var0;
   }

   public static com.aspose.cells.b.a.b.za a(int var0, int var1, int var2) {
      return new com.aspose.cells.b.a.b.za(var0, var1, var2);
   }
}
